<template>
	<view>
		<!-- 头像、名称 -->
		<view class="content-item">
			<image src="/static/image/person_bck.png"></image>
			<view class="user-info">
				<view>
					<image src="/static/image/person_face.png"></image>
				</view>
				<view class="name">
					<text>你好，游客</text>
				</view>
			</view>
		</view>
		<!-- 动态导航 -->
		<view v-for="(office,pos) in officeList[1].childrenList" :index="pos" :key="pos">
			<UniSection :title="office.title" type="line" padding>
				<uni-grid :column="4" :highlight="true" :showBorder="false">
					<uni-grid-item v-for="(item, index) in office.childrenList" :index="index" :key="index">
						<view class="grid-item-box" style="background-color: #fff;" @click="changeOffice(item)">
							<uni-icons :type="item.image" :size="30" color="#000" />
							<text style="font-size: 30rpx;">{{item.title}}</text>
						</view>
					</uni-grid-item>
				</uni-grid>
			</UniSection>
		</view>
	</view>
</template>

<script>
	import UniSection from '../../components/uni-section/uni-section'
	export default {
		components:{
			UniSection
		},
		data() {
			return {
				officeList:uni.getStorageSync("officeList")
			}
		},
		onLoad() {
			
		},
		methods: {
			/* 导航跳转 */
			changeOffice(item){
				uni.navigateTo({
					url:item.path
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	/* 顶部高度 */
	.content-item image{
		height: 400rpx;
		width: 750rpx;
	}
	/* 头像、名称 */
	.user-info{
		position: absolute;
		top: 150rpx;
		left: 50rpx;
		display: flex;
		align-items: center;
	}
	/* 头像 */
	.user-info image{
		height: 120rpx;
		width: 120rpx;
		border-radius:60rpx;
	}
	/* 名称 */
	.user-info text{
		margin-left: 16rpx;
	}
	/* 动态导航样式 */
	.grid-item-box {
		flex: 1;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: 10rpx 0;
	}
</style>
